package com.yike.product.controller;

import com.yike.product.service.GoodsPriceRecordService;
import com.yike.product.vo.GoodsPriceRecordVo;
import lombok.extern.slf4j.Slf4j;
import com.yike.product.param.GoodsPriceRecordPageParam;
import com.yike.common.base.BaseController;
import com.yike.common.api.ApiResult;
import com.yike.common.pagination.Paging;
import com.yike.common.log.Module;
import com.yike.common.log.OperationLog;
import com.yike.common.enums.OperationLogType;
import org.springframework.validation.annotation.Validated;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 商品价格记录 控制器
 *
 * @author Sakura
 * @since 2024-11-04
 */
@Slf4j
@RestController
@RequestMapping("/platform/goodsPriceRecord")
@Module("product")
@Api(value = "商平台调价记录API", tags = {"平台调价记录"})
public class GoodsPriceRecordController extends BaseController {

    @Autowired
    private GoodsPriceRecordService goodsPriceRecordService;

    @PostMapping("/getPageList")
    @OperationLog(name = "商品价格记录分页列表", type = OperationLogType.PAGE)
    @ApiOperation(value = "商品价格记录分页列表", response = GoodsPriceRecordVo.class)
    public ApiResult<Paging<GoodsPriceRecordVo>> getGoodsPriceRecordPageList(@Validated @RequestBody GoodsPriceRecordPageParam goodsPriceRecordPageParam) throws Exception {
        Paging<GoodsPriceRecordVo> paging = goodsPriceRecordService.getGoodsPriceRecordPageList(goodsPriceRecordPageParam);
        return ApiResult.ok(paging);
    }

}

